unit ListUtils;

interface

uses Classes;

function is_in_array( p_item: integer;
                      p_array: array of integer ): boolean;

function join_strings( p_list: TStrings;
                       p_delim: string ): string;

//------------------------------------------------------------------------------
implementation

function is_in_array( p_item: integer;
                      p_array: array of integer ): boolean;
var i: integer;
begin
  result := False;
  for i := 0 to Length( p_array ) - 1 do
    if p_item = p_array[i] then begin
      result := True;
    end;
end;

function join_strings( p_list: TStrings;
                       p_delim: string ): string;
var
  s: string;
  i: integer;
begin
  s := '';
  for i := 0 to p_list.Count - 1 do begin
    s := s + p_list[i];
    if i < p_list.Count - 1 then
      s := s + p_delim;
  end;
  result := s;
end;

end.
 